package com.sgcc.operate.domain.vo;

import com.sgcc.operate.util.DateFormatUtil;

import java.io.Serializable;
import java.text.ParseException;
import java.util.Date;

public class MonsysMenuDataDto implements Serializable, Comparable<MonsysMenuDataDto> {

    private static final long serialVersionUID = 1L;

    //条件字段
    private String startTime; //开始时间

    private String endTime; //结束时间

    private String name; //功能名称

    private String monSysCode;		// 监控系统编码,采用标准编码sysCode

    private String menuLevel;		// 等级

    private String isPar;		// 是否父级

    private String id;		// 树id

    //返回字段
//    @ExcelField(title="信息系统", align=2, sort=1)
    private String monSysCodeName;  // 信息系统

//    @ExcelField(title="一级功能", align=2, sort=2)
    private String oneName; // 一级功能

//    @ExcelField(title="二级功能", align=2, sort=3)
    private String twoName; // 二级功能

//    @ExcelField(title="三级功能", align=2, sort=4)
    private String threeName;   // 三级功能

//    @ExcelField(title="功能说明", align=2, sort=5)
    private String menuExplain;		// 功能说明

//    @ExcelField(title="发布时间", align=2, sort=6)
    private String releaseTime;		// 发布时间

//    @ExcelField(title="维护时间", align=2, sort=7)
    private String operTime;		// 维护时间

//    @ExcelField(title="维护人员", align=2, sort=8)
    private String operStaff;		// 维护人员

    private String accePath;		// 附件路径

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMonSysCode() {
        return monSysCode;
    }

    public void setMonSysCode(String monSysCode) {
        this.monSysCode = monSysCode;
    }

    public String getMonSysCodeName() {
        return monSysCodeName;
    }

    public void setMonSysCodeName(String monSysCodeName) {
        this.monSysCodeName = monSysCodeName;
    }

    public String getOneName() {
        return oneName;
    }

    public void setOneName(String oneName) {
        this.oneName = oneName;
    }

    public String getTwoName() {
        return twoName;
    }

    public void setTwoName(String twoName) {
        this.twoName = twoName;
    }

    public String getThreeName() {
        return threeName;
    }

    public void setThreeName(String threeName) {
        this.threeName = threeName;
    }

    public String getMenuExplain() {
        return menuExplain;
    }

    public void setMenuExplain(String menuExplain) {
        this.menuExplain = menuExplain;
    }

    public String getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(String releaseTime) {
        this.releaseTime = releaseTime;
    }

    public String getOperTime() {
        return operTime;
    }

    public void setOperTime(String operTime) {
        this.operTime = operTime;
    }

    public String getOperStaff() {
        return operStaff;
    }

    public void setOperStaff(String operStaff) {
        this.operStaff = operStaff;
    }

    public String getAccePath() {
        return accePath;
    }

    public void setAccePath(String accePath) {
        this.accePath = accePath;
    }

    public String getMenuLevel() {
        return menuLevel;
    }

    public void setMenuLevel(String menuLevel) {
        this.menuLevel = menuLevel;
    }

    public String getIsPar() {
        return isPar;
    }

    public void setIsPar(String isPar) {
        this.isPar = isPar;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public int compareTo(MonsysMenuDataDto o) {
        String operTime = this.getOperTime();
        String operTime1 = o.getOperTime();
        Date date = null;
        Date date1 = null;
        try {
            date = DateFormatUtil.pareDate(DateFormatUtil.PATTERN_DEFAULT_ON_SECOND, operTime);
            date1 = DateFormatUtil.pareDate(DateFormatUtil.PATTERN_DEFAULT_ON_SECOND, operTime1);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        if (null != date && null != date1) {
            return date1.compareTo(date);
        }
        return 0;
    }
}
